package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.entity.NursingPlan;
import com.zzyl.vo.NursingPlanVo;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @Description NursingPlanMapper
 * @Author hu hanSan
 * @Date 2024-09-08
 */
@Mapper
public interface NursingPlanMapper {

    @Select("select*from nursing_plan ")
    List<NursingPlanVo> selectAllPlan();

    //添加护理计划
    @Options(keyProperty = "id",useGeneratedKeys = true )
    @Insert(" INSERT INTO nursing_plan (sort_no, plan_name, status, create_time, update_time, create_by, update_by, remark)\n" +
            "        VALUES (#{sortNo}, #{planName}, #{status}, #{createTime}, #{updateTime}, #{createBy}, #{updateBy}, #{remark})")
    void insertPlan(NursingPlan nursingPlan);

    Page<NursingPlanVo> getByPage(String name, Integer status);

    NursingPlan selectById(Long id);

    void updatePlan(NursingPlan nursingPlan);
@Delete("delete from nursing_plan where id=#{id}")
    void deletePlanById(Long id);

    void updateStatus(Integer id, Integer status);
}
